package com.woniuxy.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.woniuxy.entity.PickGoods;
@Mapper
public interface PickGoodsMapper {
	
	@Select("select * from t_choose_goods")
	public List<PickGoods> all();
	
	@Insert("insert into t_choose_goods values(default,#{cgnu},#{category},#{num},#{client},#{area},#{status},#{goodsname},#{time},#{quality})")
	public int addPickGoods(PickGoods pickGoods);
	@Delete("delete from t_choose_goods where cgid = #{cgid}")
	public int deletePickGoods(int cgid);
	
	@Select("select * from t_choose_goods where cgid=#{cgid}")
	@Results({
		@Result(id=true,column="cgid",property="cgid"),

	})
	public PickGoods allunpack(int cgid);
	
	@Update("update t_choose_goods set status=1 where cgid=#{cgid}")
	public int updatePickGoodsStatus(int cgid); 
}
